<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <?php 
	include "includes/ketnoi.php";
	include "includes/header.php";
	?>
</head>

<body>
    <?php 
	include "includes/narbar.php";
	
	?>
	<div class="container">
	
		<div class="row">
			<div class="panel-heading">
					<h3 class="panel-title">
					<table class="table table-striped">
					<tr style="background-color:infobackground">
								<th>Chi tiết công việc</th>
								</tr>
							</h3>
							</table>
						</div>
						
        <?php
		session_start();
		
		
		$id = $_GET['id'];
		$con = mysql_connect("localhost","root","");
        mysql_select_db("timviec",$con);
		mysql_query("SET NAMES 'utf8'");
		$query = mysql_query("select * from jobs where id='$id'");
		
        while($row = mysql_fetch_array($query))
        {?>
		<form action ="" method="post">
		<table class="table table-striped">
		<tr> 
		<td width="20%"><?php echo $row["title"]?></td>
		<?php if($row["updated_at"]=='0000-00-00 00:00:00')
		{?>
		<td><?php echo "Ngày đăng: ".$row["created_at"]?></td>
		<?php } else {?>
		<td><?php echo "Ngày cập nhật: ".$row["updated_at"]?></td>
		<?php }?>
		</tr>
		<td >Mô tả :</td>
		<td><?php echo $row["content"]?></td>
		</tr>
        <tr>
        <td >Mức lương :</td>
		<td><?php echo $row["salary"]." đ"?></td>
		</tr>
		<td >Kinh nghiệm :</td>
		<td><?php echo $row["exp"]." năm"?></td>
		</tr>
        <tr>
        <td >Hạn nộp :</td>
		<td><?php echo $row["expire_at"]?></td>
		</tr>   
		</table>
		
		<?php if($row["user_id"]=='1')//if ($_SESSION['id']=='1')
		{?>
		<a href="CapNhatCongViec.php?id=<?php echo $row['id']?>">Sửa Thông Tin Công Việc</a></br>
		<a href="ThemCongViec.php?user_id=<?php echo $row['user_id']?>">Thêm Công Việc Mới</a>
		
		<?php 
		}
		else
		echo "";
		
	?>
	
       <?php }
	  
	   ?>
      	
	
	
	  <?php 
	     mysql_close($con);
        ?>
		</form>
        <br/>
       		</div>
				</div>
				</div>
			</div>
			
	</div>
	    <?php 
	include "includes/footer.php";
	?>
    </body>
</html>
